In a multi-processing system running in a multi-node network, processes often compete for “shared resources,” such as for example, data blocks in a database. Some of the shared resources may be concurrently accessed by a number of processes, while other shared resources may be accessed only by one process at a time. Consequently, various access-synchronization mechanisms have been developed to manage access the shared resources.
According to one synchronization-scheme, access to shared resources is based on the usage of “locks.” Once an appropriate lock is granted to the process, the process may access the shared resource, and use the resource until for example, the lock is relinquished, revoked, or otherwise terminated.
“Lock-based” system may include two types of locks: locks permitting concurrent access to a shared resource, and locks permitting exclusive access to the shared resource. For example, a “shared read lock” may be granted to one or more processes to allow the processes to concurrently read data from a persistent storage, whereas an “exclusive write lock” can be granted only to one process at the time, and allows only one process at the time to write data to the persistent storage.
Complexity of a “lock-based” synchronization scheme usually depends on the complexity of the multi-processing system. The more complex the multi-processing system is, the more complex “lock-based” synchronization scheme usually is. Due to their global scope, locks in the multi-node systems are often referred to as “global locks.”
Global locks are used to synchronize access of various processes to shared resources distributed on various nodes. For example, in order for a process on one node to access a shared resource residing on another node, the process has to send an appropriate request to a global lock manager and receive from it a “global lock.”
Acquiring global locks is expensive in terms of bandwidth, time and computational complexity. For example, acquiring and issuing a global lock may entail extensive communications between the nodes, execution of a number of instructions and creation of the data structures.
Further, acquiring and issuing global locks may entail a significant time delay. For example, if a process wants to read a particular data block from the persistent storage, the lock manager has to first check whether the particular data block in the persistent storage is not “stale.” The data block may be “stale” if another process has already received a global “exclusive write lock” for it and read the particular data block from the persistent storage to a cache. Thus, if a process wants to read the particular data that is “stale,” the global lock manager waits until the global “exclusive write lock” is relinquished. Subsequently, the lock manager issues the global shared lock to the requesting process. This type of “waiting” may contribute to a significant time delay before the requesting process may actually access the particular data block.
As clearly shown, techniques are needed to reduce the overhead of global locks, when nodes access data in a multi-node system.
The approaches described in this section are approaches that could be pursued, but not necessarily approaches that have been previously conceived or pursued. Therefore, unless otherwise indicated, it should not be assumed that any of the approaches described in this section qualify as prior art merely by virtue of their inclusion in this section.